/*
 * ClientStartingGameStateController.h
 *
 *  Created on: Dec 27, 2011
 *      Author: rudi
 */

#ifndef CLIENTSTARTINGGAMESTATECONTROLLER_H_
#define CLIENTSTARTINGGAMESTATECONTROLLER_H_
#include <wx/wx.h>
#include "IGameStateController.h"
#include "LogoDrawController.h"

class wxSocketEvent;

/**
 * This class handles the procedure of the client starting
 *
 * Client starting includes the connection to the server, receiving the level and the configuration negotiation
 * @see IGameStateController
 * @author Rudolf Heszele heszele@gmail.com
 * @version 1.0
 * @since 2012-03-08
 */
class ClientStartingGameStateController: public IGameStateController
{
	public:
		/**
		 * The only constructor takes the name of the host and the port number
		 *
		 * @param host The name or IP address of the host
		 * @param portNumber The number of port to connect to
		 */
		ClientStartingGameStateController(const wxString& host, int portNumber);
		virtual ~ClientStartingGameStateController();

		// Methods inherited from IController

		/**
		 * @see IController::handleMouseDown
		 */
		virtual void handleMouseDown(const wxPoint&);
		/**
		 * @see IController::handleMouseUp
		 */
		virtual void handleMouseUp(const wxPoint&);
		/**
		 * @see IController::handleMouseMotion
		 */
		virtual bool handleMouseMotion(const wxPoint&);
		/**
		 * @see IController::getBitmapToPaint
		 */
		virtual const wxBitmap& getBitmapToPaint() const;
		/**
		 * @see IController::getBitmapToDraw
		 */
		virtual wxBitmap& getBitmapToDraw();

		// Methods inherited from IGameStateController

		/**
		 * @see IGameStateContrller::handleSocketConnection
		 */
		virtual void handleSocketConnection(wxSocketEvent&);
		/**
		 * @see IGameStateContrller::handleSocketLost
		 */
		virtual void handleSocketLost(wxSocketEvent&);
		/**
		 * @see IGameStateContrller::handleSocketInput
		 */
		virtual void handleSocketInput(wxSocketEvent& socketEvent);
		/**
		 * @see IGameStateContrller::handleSocketOutput
		 */
		virtual void handleSocketOutput(wxSocketEvent&);

	private:
		/**
		 * This object handles the drawings during this state of the application
		 *
		 * @see LogoDrawController
		 */
		LogoDrawController mLogoDrawController;
		/**
		 * true if the object is created because of level changing
		 */
		bool mIsNewLevel;
};

#endif /* CLIENTSTARTINGGAMESTATECONTROLLER_H_ */
